package com.dayuanit.controller;

import com.dayuanit.controller.request.EquipmentInfoTableEditParam;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RouterController {


    /**
     * 登录页
     * @return
     */
    @RequestMapping(value = "")
    public String login() {
        return "login";
    }

    /**
     * 前台用户登录页
     * @return
     */
    @RequestMapping(value = "applyUserRegister")
    public String applyUserRegister() {
        return "register";
    }

    /**
     * 默认页
     * @return
     */
    @RequestMapping(value = "index")
    public String index() {
        return "index";
    }

    /**
     * 403页面
     * @return
     */
    @RequestMapping(value = "403")
    public String error403() {
        return "/view/error/403";
    }

    /**
     * 404页面
     * @return
     */
    @RequestMapping(value = "404")
    public String error404() {
        return "/view/error/404";
    }

    /**
     * 500页面
     * @return
     */
    @RequestMapping(value = "500")
    public String error500() {
        return "/view/error/500";
    }


    @RequestMapping(value = "errorResult")
    public String error() {
        return "/view/result/error";
    }

    @RequestMapping(value = "successResult")
    public String success() {
        return "/view/result/success";
    }

    @RequestMapping(value = "console1")
    public String console1() {
        return "/view/console/console1";
    }

    @RequestMapping(value = "console2")
    public String console2() {
        return "/view/console/console2";
    }


    @RequestMapping(value = "applyUserInfo")
    public String applyUserInfo() {
        return "/view/system/person.html";
    }

    @RequestMapping(value = "table")
    public String table() {
        return "view/document/table";
    }


    /**
     * 设备信息管理页面
     * @return
     */
    @RequestMapping(value = "/equipment/infoTable")
    public String equipmentInfoTable() {
        return "view/equipment/infoTable";
    }


    /**
     * 设备信息新增页面
     * @return
     */
    @RequestMapping(value = "/equipment/infoTable/add")
    public String equipmentInfoTableAdd() {
        return "view/equipment/add";
    }


    /**
     * 设备信息编辑页面
     * @return
     */
    @RequestMapping(value = "/equipment/infoTable/edit")
    public String equipmentInfoTableEdit(EquipmentInfoTableEditParam param, ModelMap modelMap) {
        modelMap.put("id",param.getId());
        modelMap.put("equipmentName",param.getEquipmentName());
        modelMap.put("color",param.getColor());
        modelMap.put("size",param.getSize());
        modelMap.put("useAge",param.getUseAge());
        modelMap.put("useStatus",param.getUseStatus());
        modelMap.put("healthStatus",param.getHealthStatus());
        modelMap.put("price",param.getPrice());
        return "view/equipment/edit";
    }

    /**
     * 设备出入库管理
     *
     *
     * @return
     */
    @RequestMapping(value = "/warehouseRecord/infoTable")
    public String warehouseRecordTable() {
        return "view/warehouseRecord/infoTable";
    }



    /**
     * 设备出入库新增页面
     * @return
     */
    @RequestMapping(value = "/warehouseRecord/infoTable/add")
    public String warehouseRecordTableAdd() {
        return "view/warehouseRecord/add";
    }


    /**
     * 设备计划管理页面
     * @return
     */
    @RequestMapping(value = "/equipmentPlan/infoTable")
    public String equipmentPlanTable() {
        return "view/equipmentPlan/infoTable";
    }


    /**
     * 设备计划新增页面
     * @return
     */
    @RequestMapping(value = "/equipmentPlan/infoTable/add")
    public String equipmentPlanTableAdd() {
        return "view/equipmentPlan/add";
    }


    @RequestMapping(value = "reportFormLine")
    public String reportFormLine() {
        return "view/echarts/line";
    }

    @RequestMapping(value = "reportFormColumn")
    public String reportFormColumn() {
        return "view/echarts/column";
    }
}
